<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>jquery 折叠菜单的实现</title>
  <style>
    *{
      padding: 0;
      margin: 0;
      list-style: none;
    }
    .content{
      width: 50%;
      margin: 50px auto;
    }
    .title{
      border: 1px solid #000;
      background-color: rgb(160, 100, 201);
    }
    .tl{
      display: none;
    }

  </style>
</head>
<script src="js/jquery-1.12.4.min.js"></script>
<script>
  $(function(){
    $('.title').hover(function(){
      $('.tl').stop().slideToggle();
    });
  });
</script>
<body>
  <div class="content">
    <li class="title">我是一级菜单</li>
    <div class="tl">
      <li>我是二级菜单</li>
      <li>我是二级菜单</li>
      <li>我是二级菜单</li>
      <li>我是二级菜单</li>
      <li>我是二级菜单</li>
    </div>
  </div>
</body>
</html>